<?
include "/home/www/skiaplanche.ca/classes/Smarty/Smarty.class.php";
include "/home/www/skiaplanche.ca/classes/vote.class.php";
include "/home/www/skiaplanche.ca/classes/bd.class.php";
include "/home/www/skiaplanche.ca/classes/log.class.php";
include "/home/www/skiaplanche.ca/classes/montagnes.class.php";
include "/home/www/skiaplanche.ca/classes/securite.class.php";
include "/home/www/skiaplanche.ca/classes/usagers.class.php";
include "/home/www/skiaplanche.ca/parametres/paramBD.php";
include "/home/www/skiaplanche.ca/classes/categoriesCritere.class.php";
include "/home/www/skiaplanche.ca/classes/criteres.class.php";
include "/home/www/skiaplanche.ca/classes/classement.class.php";
include "/home/www/skiaplanche.ca/classes/phpMailer/class.phpmailer.php";
include "/home/www/skiaplanche.ca/fonctions/genereCodeSecret.php";


session_start();
/* Instantiation de la connexion à la base de données */
$objBD = new BD( $paramBD );
	
// Instanciation de l'environnement graphique
$smarty = new Smarty();
$smarty->template_dir = '/home/www/skiaplanche.ca/templates';
$smarty->compile_dir = '/home/www/skiaplanche.ca/templates_c';
$smarty->cache_dir = '/home/www/skiaplanche.ca/cache';
$smarty->compile_check = true;
$smarty->debugging = false;	

/* initialisation de la sécurité */
$objSecurite = new Securite( $objBD );
if( !isset( $_SESSION[ 'user_email' ] ) ) {
	$smarty->assign( "box_login", 0 );
} else {
	$smarty->assign( "box_login", 1 );
	$smarty->assign( "user_nom", $_SESSION[ 'user_nom' ] );
	$smarty->assign( "user_access", $_SESSION[ 'user_access' ] );
}

/* assignement du classement général des montagnes */
$objVotes = new Vote( $objBD );
$smarty->assign( "classementGeneral", $objVotes->getClassementGlobal() );
//$smarty->debugging = true;
?>